package com.itlong.cloud.equip.property;

import com.itlong.cloud.POJO.DTO.property.PropertyPadListDTO;
import com.itlong.cloud.POJO.VO.property.PropertyPadGetOneVO;
import com.itlong.cloud.POJO.VO.property.PropertyPadListVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * <desc>
 *      物业平板业务交互暴露接口
 * </desc>
 *
 * @createDate 2019/01/17
 */
@FeignClient(name = "equip-service")
public interface IPropertyPadServiceClient {
    /**
     * <desc>
     *      获取人脸平板列表
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/getList")
    Page<PropertyPadListVO> getList(@RequestBody PropertyPadListDTO dto) throws Exception;

    /**
     * <desc>
     *      删除设备
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/delete")
    Integer delete(@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      获取单个平板信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/getOne")
    PropertyPadGetOneVO getOne(@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *     添加平板信息
     * </desc>
     *
     * @param vo
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/add")
    String add(@RequestBody PropertyPadGetOneVO vo) throws Exception;

    /**
     * <desc>
     *      修改平板
     * </desc>
     *
     * @param vo
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/update")
    String update(@RequestBody PropertyPadGetOneVO vo) throws Exception;

    /**
     * <desc>
     *     添加时检测机号是否重复
     * </desc>
     *
     * @param projectId
     * @param deviceId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/17
     */
    @PostMapping("/property/equip/pad/checkPadDeviceRepeat")
    Integer checkPadDeviceRepeat(@RequestParam("projectId") String projectId,
                                 @RequestParam("deviceId") String deviceId,
                                 @RequestParam("type") Integer type);

    /**
     * <desc>
     *      根据deviceUnique找出绑定该设备的平板设备
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @Author Zhu.yj
     * @createDate  2019/12/17
     */
    @PostMapping("/property/equip/pad/getPadDeviceUniqueByBindDevice")
    List<String> getPadDeviceUniqueByBindDevice(@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      更改平板设备地址
     * </desc>
     *
     * @param newUnitIdStr 要添加的单元集合
     * @param deviceUnique 设备编号
     * @param padDeviceUniqueList 平板设备编号集合
     * @param projectId 项目id
     * @return 1成功
     * @Author Zhu.yj
     * @createDate  2019/12/17
     */
    @PostMapping("/property/equip/pad/updatePadAddress")
    Integer updatePadAddress(@RequestParam("newUnitIdStr") String newUnitIdStr,
                             @RequestParam("deviceUnique") String deviceUnique,
                             @RequestBody List<String> padDeviceUniqueList,
                             @RequestParam("projectId") String projectId) throws Exception;
}
